package com.damie.web.exception;


import com.damie.common.commonutils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;


@RestControllerAdvice
public class GlobalExceptionHandler{
    @ExceptionHandler({MyException.class})
    @ResponseBody
    public R myException(MyException e){
        e.printStackTrace();
        return R.error().message("请求错误");
    }
}
